import { NgModule } from '@angular/core';
import { SharedModule } from '@shared';
import { SysRoutingModule } from './sys-routing.module';
import { SysUserComponent } from './user/user.component';
import { SysUserEditComponent } from './user/edit/edit.component';
import { SysRoleComponent } from './role/role.component';
import { SysRoleEditComponent } from './role/edit/edit.component';
import { SysGroupComponent } from './group/group.component';
import { SysGroupEditComponent } from './group/edit/edit.component';
import { SysTenantComponent } from './tenant/tenant.component';
import { SysTenantEditComponent } from './tenant/edit/edit.component';
import { SysResourceComponent } from './resource/resource.component';
import { SysResourceEditComponent } from './resource/edit/edit.component';
import { SysRouteComponent } from './route/route.component';
import { SysRouteEditComponent } from './route/edit/edit.component';
import { SysKeyValueComponent } from './keyvalue/keyValue.component';
import { SysKeyValueEditComponent } from './keyvalue/edit/edit.component';
import { SimpleActionComponent } from '../simple/action/list.component';

const COMPONENTS = [
  SysUserComponent,
  SysRoleComponent,
  SysGroupComponent,
  SysTenantComponent,
  SysResourceComponent,
  SysRouteComponent,
  SysKeyValueComponent,
  SimpleActionComponent,
];

const EDIT_COMPONENTS = [SysResourceEditComponent];

const COMPONENTS_NOROUNT = [
  SysUserEditComponent,
  SysRoleEditComponent,
  SysGroupEditComponent,
  SysTenantEditComponent,
  SysResourceEditComponent,
  SysRouteEditComponent,
  SysKeyValueEditComponent,
];

@NgModule({
  imports: [SharedModule, SysRoutingModule],
  declarations: [...COMPONENTS, ...COMPONENTS_NOROUNT, ...EDIT_COMPONENTS],
  entryComponents: COMPONENTS_NOROUNT,
  exports: [...EDIT_COMPONENTS],
})
export class SysModule {}
